package top.datacluster.basic.structure.tree;

public interface BinaryTree {

    public boolean insert(Node node);


    class Node<T>{

        public T data;
        public Node left;
        public Node right;

        public Node(T data) {
            this.data = data;
        }

        public Node(T data, Node left, Node right) {
            this.data = data;
            this.left = left;
            this.right = right;
        }

        public T getData() {
            return data;
        }

        public void setData(T data) {
            this.data = data;
        }

        public Node getLeft() {
            return left;
        }

        public void setLeft(Node left) {
            this.left = left;
        }

        public Node getRight() {
            return right;
        }

        public void setRight(Node right) {
            this.right = right;
        }
    }
}
